package com.nowcoder;

import java.util.Scanner;

/**
 * 质数因子，输入一个正整数，按照从小到大的顺序输出它的所有质因子（重复的也要列举）
 */
public class PrimeFactor {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int source = in.nextInt();
        double sqrt = Math.sqrt(source);
        while (source >= sqrt) {
            boolean flag = false;
            for (int i = 2; i <= Math.sqrt(source); i++) {
                if (source % i == 0) {
                    System.out.print(i);
                    System.out.print(" ");
                    source = source / i;
                    flag = true;
                }
                if (flag) {
                    break;
                }
            }
            if (!flag) {
                break;
            }
        }
        System.out.println(source);
    }
}
